package main

import (
	"fmt"
	"net/url"
)

func main() {
	var myUrl *url.URL
	var err error
	myUrl, err = url.Parse("http://www.oschina.net/question?catalog=1&show=mine#dsdsd#v")
	if err != nil {
		fmt.Println("解析url失败")
		return
	}
	fmt.Println(myUrl.IsAbs())
	fmt.Println(myUrl.Host)
	//fmt.Println(myUrl.Opaque)
	fmt.Println(myUrl.User)
	fmt.Println(myUrl.RawQuery)
	fmt.Println(myUrl.Fragment)

	//调取查询的信息
	urlV := myUrl.Query()
	fmt.Println(urlV.Get("catalog"))

}
